build: use xml-stripblanks with .ui resources
authorChristian Hergert <chergert@redhat.com>
Sun, 12 Nov 2017 23:18:21 +0000 (15:18 -0800)
committerChristian Hergert <chergert@redhat.com>
Sat, 23 Jun 2018 19:42:25 +0000 (12:42 -0700)
This adds a preprocess step to the .ui files to strip them of blank
characters. It also removes the compressed='true' from the .ui files since
that involves creating lots of decompressor objects when creating widgets.
Doing so has runtime overhead and slows down the creation of initial
application windows.

The .ui files are left compressed for the Inspector, since that is not in
the core performance path of application startup.

gtk/Makefile.am

index 54a2ca4908dd285c78d237bb42265660f426703f..795c885da83b66f8f47a8882eaddbc2006031f80 100644 (file)
@@ -1309,7 +1309,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
        done; \
        for f in $(srcdir)/ui/*.ui; do \
          n=`basename $$f`; \
-         echo "    <file compressed='true'>ui/$$n</file>" >> $@; \
+         echo "    <file preprocess='xml-stripblanks'>ui/$$n</file>" >> $@; \
        done; \
        for s in 16x16 22x22 24x24 32x32 48x48; do \
          for c in actions status; do \
@@ -1322,7 +1322,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
        done; \
        for f in $(srcdir)/inspector/*.ui; do \
          n=`basename $$f`; \
-         echo "    <file compressed='true'>inspector/$$n</file>" >> $@; \
+         echo "    <file compressed='true' preprocess='xml-stripblanks'>inspector/$$n</file>" >> $@; \
        done; \
        echo "    <file>inspector/logo.png</file>" >> $@; \
        echo "    <file>emoji/emoji.data</file>" >> $@; \